package com.zyw.orm.support.page;

import org.apache.commons.lang3.StringUtils;

/**
 * @author zhangyw
 * @date 2017/9/18 10:00
 */
public class Sort {

    private String orderField;

    private String orderType; // ASC 升序, DESC 倒序

    public Sort() {
    }

    public Sort(String orderField) {
        this.orderField = orderField;
        this.orderType = "ASC"; // 默认升序
    }

    public Sort(String orderField, String orderType) {
        this.orderField = orderField;
        this.orderType = StringUtils.isEmpty(orderType) ? "ASC" : orderType;
    }

    public String getOrderField() {
        return orderField;
    }

    public void setOrderField(String orderField) {
        this.orderField = orderField;
    }

    public String getOrderType() {
        return orderType;
    }

    public void setOrderType(String orderType) {
        this.orderType = orderType;
    }
}
